<?php
$this->title = '个人信息';
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>设置</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0" />
    <meta name="format-detection" content="telephone=no,email=no" />
    <meta name="mobileOptimized" content="width" />
    <meta name="handheldFriendly" content="true" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <link rel="stylesheet" href="/static/css/main.css" />
    <script src="/static/script/zepto.min.js"></script>
</head>
<body class="m-my-set u-bg1">

<dl class="f-cb"><dt>昵称</dt><dd id="J_editName"><?= empty($data['user']['nickname']) ?  '点击输入昵称' : $data['user']['nickname']?></dd></dl>
<dl class="f-cb"><dt>头像</dt><dd id="J_editAvatar"><img class="avatar" src="<?= $data['photo']?>"></dd></dl>
<dl class="f-cb"><dt>手机号码</dt><dd><?= $data['user']['mobile']?></dd></dl>
<dl class="f-cb"><dt>邮箱</dt><dd id="J_editMail"><?= empty($data['user']['email']) ?  '点击输入邮箱' : $data['user']['email']?></dd></dl>
<dl class="f-cb"><dt>收货地址</dt><dd id="J_editAddress"><?= empty($data['address']['detail']) ?  '您还没有添加收货地址' : $data['address']['detail']?></dd></dl>

<h4><a href="/web/my">返回</a></h4>

<script>
    $(function(){
        $('#J_editAddress').click(function(){
            window.location.href = '/web/address';
        });
        $('#J_editName').click(function(){
            window.location.href = '/web/user/update?nickname=<?= $data['user']['nickname']?>';
        });
        $('#J_editPhone').click(function(){
            window.location.href = '/web/user/update?mobile=<?= $data['user']['mobile']?>';
        });
        $('#J_editMail').click(function(){
            window.location.href = '/web/user/update?email=<?= $data['user']['email']?>';
        });
    });

</script>
</body>
</html>